<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/jquery.js"></script> 
<script src="/wondershare/js/task.js"></script>
<link href="/wondershare/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/wondershare/styles/general.css" rel="stylesheet" type="text/css" />
</head>
<body >
<h1>
    <span class="action-span1">
    <a href="/wondershare/task_server.php?action=index" style="text-decoration:underline">服务器管理</a> 
    </span>
    <span id="search_id" class="action-span1"> - 服务器信息<{$title}> </span>
    <div style="clear:both"></div>
</h1>
<div id="tabbody-div"  style=" width:1100px;">
    <form  name="theForm" method="post" action="/wondershare/task_server.php?action=editSubmit" onsubmit="return checkSubmit();">
        <table align="center" width="90%" id="general-table">
        <tbody>
            <tr>
                <td class="label">服务器名称：</td>
                <td>
                    <input type="text" size="60" style="float:left;color:;" value="<{$server_row.serName|escape}>" name="serName" id="serName"> 
                    <span class="require-field">*</span>
                </td>
            </tr>
            
            <tr>
                <td class="label">服务器IP：</td>
                <td>
                    <input type="text" size="60" style="float:left;color:;" value="<{$server_row.serIp|escape}>" name="serIP" id="serIP"> 
                    <span class="require-field">*</span>
                </td>
            </tr>        
        
        </tbody>
        </table>
        <div  style="margin-left:380px; margin-top:20px;">
        
        <input type="hidden"  name="serId" id="serId" value="<{$server_row.serId}>">
        <input type="hidden" value="<{$form_act}>" name="act" id="act" />
        <input type="submit"   class="button" value="<{$form_value}> " name="sub_from" id='sub_from' />
        <input type="reset" class="button" value=" 重置 ">
        </div>
    </form>
</div>
<script>
//验证提交的数据
function checkSubmit() {
	
	var serName= $('#serName').val().replace(/(^\s*)|(\s*$)/g, "");
	var serIP = $('#serIP').val().replace(/(^\s*)|(\s*$)/g, "");

	
	if ( serName == '' ) {
		alert('服务器名不能为空！');
		$("#serName").focus();
		return false;
	}
	
	if ( serIP == '' ) {
		alert('服务器IP不能为空！');
		$("#serIP").focus();
		return false;
	}
	
	if (isIP(serIP) == false){
      alert("服务器IP不是合法的IP地址！");
      $("#serIP").focus();
      return false;
    }
	
	return true;
	
}
	
</script>
</body>
</html>